<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
    

    

    



    <meta charset="utf-8">
    
    
    <meta name="sogou_site_verification" content="true">
    
    
    
    <title>Lvshen&#39;s Blog | This is My World</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content>
    <meta name="baidu-site-verification" content="VIVNdSiMZm">
    <meta name="description" content="学如逆水行舟，不进则退">
<meta property="og:type" content="website">
<meta property="og:title" content="Lvshen&#39;s Blog">
<meta property="og:url" content="https://lvshen9.gitee.io/page/8/index.html">
<meta property="og:site_name" content="Lvshen&#39;s Blog">
<meta property="og:description" content="学如逆水行舟，不进则退">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Lvshen&#39;s Blog">
<meta name="twitter:description" content="学如逆水行舟，不进则退">
    
    <link rel="shortcut icon" href="/img/mylogo.jpg">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu"  >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">我的技术小房间</h5>
          <a href="mailto:https://lvshen9.github.io" title="https://lvshen9.github.io" class="mail">https://lvshen9.github.io</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/about"  >
                <i class="icon icon-lg icon-address-book"></i>
                About
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/collection"  >
                <i class="icon icon-lg icon-apple"></i>
                Collection
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://lvshen9.github.io/" target="_blank" >
                <i class="icon icon-lg icon-wordpress"></i>
                Blog
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/lvshen9" target="_blank" >
                <i class="icon icon-lg icon-github-alt"></i>
                GitHub
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">Lvshen&#39;s Blog</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header index-header">

    <div class="container fade-scale">
        <h1 class="title">Lvshen&#39;s Blog</h1>
        <h5 class="subtitle">
            
                This is My World
            
        </h5>
    </div>

    


</header>

<div class="container body-wrap">

    <ul class="post-list">
    
        <li class="post-list-item fade">
            <article id="post-【Java】设计模式：深入理解单例模式"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-04 21:21:41" datetime="2017-09-04T13:21:41.000Z"  itemprop="datePublished">2017-09-04</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/04/【Java】设计模式：深入理解单例模式/">【Java】设计模式：深入理解单例模式</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <blockquote>
<p>什么是设计模式？简单的理解就是前人留下来的一些经验总结而已，然后把这些经验起了个名字叫Design Pattern，翻译过来就是设计模式，通过使用设计模式可以让我们的代码复用性更高，可维护性更高，让你的代码写的更优雅。设计模式理论上有23种，今天就先来分享下最常用的单例模式。</p>
</blockquote>
<h3 id="引言"><a href="#引言" class="headerlink" title="引言"></a><strong>引言</strong></h3><p>对于单例模式，有工作经验的人基本上都使用过。面试的时候提到设计模式基本上都会提到单例模式，但是很多人对单例模式也是一知半解，当然也包括我哈哈哈=_=。所以我们有必要深入理解一下所谓的「单例模式」。</p>
<h3 id="单例模式"><a href="#单例模式" class="headerlink" title="单例模式"></a><strong>单例模式</strong></h3><p>定义：<strong>保证一个类仅有一个实例，并提供一个访问它的全局访问点。</strong></p>
<p>单例模式结构图：</p>
<p>[<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://img.blog.csdn.net/20160908131425758" alt="img](http://img.blog.csdn.net/20160908131425758)" title>
                </div>
                <div class="image-caption">img](http://img.blog.csdn.net/20160908131425758)</div>
            </figure></p>
    

        <a href="/2017/09/04/【Java】设计模式：深入理解单例模式/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/单列/">单列</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/设计模式/">设计模式</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-Google-面试题-判断字符串是否可由重复子字符串组成"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-04 21:12:05" datetime="2017-09-04T13:12:05.000Z"  itemprop="datePublished">2017-09-04</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/04/Google-面试题-判断字符串是否可由重复子字符串组成/">Google 面试题 | 判断字符串是否可由重复子字符串组成</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <h2 id="题目描述"><a href="#题目描述" class="headerlink" title="题目描述"></a><strong>题目描述</strong></h2><p>对于一个非空字符串，判断其是否可由一个子字符串重复多次组成。字符串只包含小写字母且长度不超过10000。</p>
<h3 id="样例1"><a href="#样例1" class="headerlink" title="样例1"></a>样例1</h3><blockquote>
<ul>
<li><strong>输入</strong>： “abab”</li>
<li><strong>输出</strong>： True</li>
<li><strong>样例解释</strong>： 输入可由”ab”重复两次组成</li>
</ul>
</blockquote>
<h3 id="样例-2"><a href="#样例-2" class="headerlink" title="样例 2"></a>样例 2</h3><blockquote>
<ul>
<li><strong>输入</strong>： “aba”</li>
<li><strong>输出</strong>： False</li>
</ul>
</blockquote>
<h3 id="样例-3"><a href="#样例-3" class="headerlink" title="样例 3"></a>样例 3</h3><blockquote>
<ul>
<li><strong>输入</strong>： “abcabcabcabc”</li>
<li><strong>输出</strong>： True</li>
<li><strong>样例解释</strong>：输入可由”abc”重复四次组成</li>
</ul>
</blockquote>
    

        <a href="/2017/09/04/Google-面试题-判断字符串是否可由重复子字符串组成/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/字符串/">字符串</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/算法/">算法</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-【Learning】机器学习：简明入门指南”"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-04 19:53:07" datetime="2017-09-04T11:53:07.000Z"  itemprop="datePublished">2017-09-04</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/04/【Learning】机器学习：简明入门指南”/">【machine Learning】机器学习：简明入门指南”</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <blockquote>
<p>本文是一篇转载自<a href="http://blog.jobbole.com/67616/" target="_blank" rel="noopener"><strong>伯乐在线的译文</strong></a>，英文原文是这里：<a href="https://medium.com/code-poet/80ea3ec3c471" target="_blank" rel="noopener"><strong>Machine Learning is Fun!</strong> — by Adam Geitgey</a></p>
</blockquote>
<p>在听到人们谈论机器学习的时候，你是不是对它的涵义只有几个模糊的认识呢？你是不是已经厌倦了在和同事交谈时只能一直点头？让我们改变一下吧！</p>
<p>本指南的读者对象是所有对机器学习有求知欲但却不知道如何开头的朋友。我猜很多人已经读过了<a href="https://en.wikipedia.org/wiki/Machine_learning" target="_blank" rel="noopener">“机器学习” ——维基百科词条</a>，倍感挫折，以为没人能给出一个高层次的解释。本文就是你们想要的东西。</p>
<p>本文目标在于平易近人，这意味着文中有大量的概括。但是谁在乎这些呢？只要能让读者对于ML更感兴趣，任务也就完成了。</p>
    

        <a href="/2017/09/04/【Learning】机器学习：简明入门指南”/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/机器学习/">机器学习</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-You-don-t-know-Js"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-03 22:56:21" datetime="2017-09-03T14:56:21.000Z"  itemprop="datePublished">2017-09-03</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/03/You-don-t-know-Js/">You don&#39;t know Js</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <h4 id="作用域"><a href="#作用域" class="headerlink" title="作用域"></a>作用域</h4><blockquote>
<p>一门语言需要一套设计良好的规则来存储变量，并且之后可以方便的找到这些变量，这逃规则被称为作用域。</p>
</blockquote>
<p>这也意味着当我们访问一个变量的时候，决定这个变量能否访问到的依据就是这个作用域。</p>
<h5 id="词法作用域"><a href="#词法作用域" class="headerlink" title="词法作用域"></a>词法作用域</h5><p>作用域共有两种主要的工作模型，第一种是最为普通的，被大多数编程语言（包括javascript）采用的<code>词法作用域</code>，另一种叫做<code>动态作用域</code>。而我们平时所提及的作用域，就是这里所说的<code>词法作用域</code>。</p>
<p>要了解词法作用域，必须要了解javascript引擎以及编译器的大概工作方式。一般程序中的源码在执行前会进行编译三步骤。</p>
<ul>
<li>分词/语法分析</li>
<li>解析/语法分析</li>
<li>代码生成</li>
</ul>
<p>而在分词/词法分析这个步骤，就已经确定了词法作用域。也就说作用域在我们书写代码的时候就已经确定了，引用书中的文字</p>
    

        <a href="/2017/09/03/You-don-t-know-Js/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/作用域/">作用域</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-死锁的那点事儿"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-02 21:14:54" datetime="2017-09-02T13:14:54.000Z"  itemprop="datePublished">2017-09-02</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/02/死锁的那点事儿/">死锁的那点事儿</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <blockquote>
<p>本文我们将研究什么是死锁以及怎么避免死锁</p>
</blockquote>
<h4 id="什么死锁"><a href="#什么死锁" class="headerlink" title="什么死锁"></a>什么死锁</h4><p>简单来说，多线程在高并发访问系统资源时，出于安全目的，会给线程枷锁。然而在线程安全的同时会带来一个头疼的问题，死锁。那么，什么是死锁，就是多个线程在竞争系统资源时产生的一种僵局，若无外力作用，线程将无法推进。</p>
<p>比如，两人相向过独木桥，都要等对方过来，才能过去。这样的结果是谁都过不去，白白消耗了时间。</p>
<h4 id="为什么会产生死锁"><a href="#为什么会产生死锁" class="headerlink" title="为什么会产生死锁"></a>为什么会产生死锁</h4><h5 id="1-系统资源的竞争"><a href="#1-系统资源的竞争" class="headerlink" title="1) 系统资源的竞争"></a>1) 系统资源的竞争</h5><p>通常系统中拥有的不可剥夺资源，其数量不足以满足多个进程运行的需要，使得进程在 运行过程中，会因争夺资源而陷入僵局，如磁带机、打印机等。只有对不可剥夺资源的竞争 才可能产生死锁，对可剥夺资源的竞争是不会引起死锁的。</p>
    

        <a href="/2017/09/02/死锁的那点事儿/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/多线程/">多线程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/死锁/">死锁</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-How-to-learning-Shiro-2"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-01 20:52:05" datetime="2017-09-01T12:52:05.000Z"  itemprop="datePublished">2017-09-01</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/01/How-to-learning-Shiro-2/">How to learning Shiro(2)</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <p>前面我们学习了Shiro的基本架构，以及Shiro的认证和授权机制，今天我们聊聊Shiro在<code>xml</code>文件中的配置</p>
<p>Shiro的配置主要有如下几个部分：</p>
<ul>
<li>对象和属性的定义与配置</li>
<li>URL的过滤器配置</li>
<li>静态用户配置</li>
<li>静态角色配置</li>
</ul>
<p>其中，用户与角色一般有后台操作，其数据是动态的，所以<code>xml</code>的配置主要包含前两项。</p>
<p>我们主要讲解Spring XML的文件配置。</p>
    

        <a href="/2017/09/01/How-to-learning-Shiro-2/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Shiro/">Shiro</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/权限/">权限</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-Shiro学习"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-08-31 22:47:25" datetime="2017-08-31T14:47:25.000Z"  itemprop="datePublished">2017-08-31</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/08/31/Shiro学习/">How to learning Shiro</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <p>今天我们来聊聊<code>Shiro</code>的那些事。</p>
<h4 id="Shiro的基本介绍"><a href="#Shiro的基本介绍" class="headerlink" title="Shiro的基本介绍"></a>Shiro的基本介绍</h4><h5 id="1-Shiro是什么？"><a href="#1-Shiro是什么？" class="headerlink" title="1.Shiro是什么？"></a>1.Shiro是什么？</h5><p>很多人对<code>Shiro</code>并不了解，<code>Shiro</code>是Apache(<code>这公司啥玩意都做</code>)公司发布的一款安全框架，主要用于<code>Java</code>，Shiro具有以下功能：</p>
<ul>
<li>认证 - 用户身份识别，常被称为用户“登录”；</li>
</ul>
<ul>
<li>授权 - 访问控制；</li>
</ul>
<ul>
<li>密码加密 - 保护或隐藏数据防止被偷窥；</li>
</ul>
<ul>
<li>会话管理 - 每个用户相关的时间敏感的状态。                                                                                            </li>
</ul>
<p>Shiro可以提供安全而全面的管理服务，广泛应用与<code>JavaEE</code>后台的权限管理。Shiro相对于其他的安全框架(如：Spring Security）更加轻量级。</p>
    

        <a href="/2017/08/31/Shiro学习/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Shiro/">Shiro</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/权限/">权限</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-我在Github上一个关于俄罗斯方块的项目"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-08-30 08:50:44" datetime="2017-08-30T00:50:44.000Z"  itemprop="datePublished">2017-08-30</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/游戏/">游戏</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/08/30/我在Github上一个关于俄罗斯方块的项目/">我在Github上一个关于俄罗斯方块的项目</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <blockquote>
<p>Hi，这是我在Github上一个关于俄罗斯方块的项目，欢迎star和fork，下面做一个简短的介绍</p>
<p>项目地址：<a href="https://github.com/lvshen9/myTetris" target="_blank" rel="noopener">myTetris</a></p>
</blockquote>
<h5 id="项目特色"><a href="#项目特色" class="headerlink" title="项目特色:"></a>项目特色:</h5><p>本项目基于Java开发，SQL Server做数据库，JDBC实现数据库与游戏实体通信，界面主要采用Java的awt,swing包开发。</p>
    

        <a href="/2017/08/30/我在Github上一个关于俄罗斯方块的项目/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Github/">Github</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/俄罗斯方块/">俄罗斯方块</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-JavaScript常用代码集合"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-08-29 15:37:05" datetime="2017-08-29T07:37:05.000Z"  itemprop="datePublished">2017-08-29</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/08/29/JavaScript常用代码集合/">JavaScript常用代码集合</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <blockquote>
<p>手机类型判断</p>
</blockquote>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> BrowserInfo = &#123;    </span><br><span class="line">    userAgent: navigator.userAgent.toLowerCase()</span><br><span class="line">    isAndroid: <span class="built_in">Boolean</span>(navigator.userAgent.match(<span class="regexp">/android/ig</span>)),</span><br><span class="line">    isIphone: <span class="built_in">Boolean</span>(navigator.userAgent.match(<span class="regexp">/iphone|ipod/ig</span>)),</span><br><span class="line">    isIpad: <span class="built_in">Boolean</span>(navigator.userAgent.match(<span class="regexp">/ipad/ig</span>)),</span><br><span class="line">    isWeixin: <span class="built_in">Boolean</span>(navigator.userAgent.match(<span class="regexp">/MicroMessenger/ig</span>)),</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
    

        <a href="/2017/08/29/JavaScript常用代码集合/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/前端/">前端</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-如何在MySQL中使用索引"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-08-29 08:23:33" datetime="2017-08-29T00:23:33.000Z"  itemprop="datePublished">2017-08-29</time>

        
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/技术/">技术</a></li></ul>



    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/08/29/如何在MySQL中使用索引/">如何在MySQL中使用索引</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        <h4 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h4><p>为了在数据库中快速查找我们要的记录，通常会使用索引。合理的使用索引能大大的提高数据库的访问性能。本文主要介绍如何在MySQL数据库中使用索引，以及如何创建高效的索引。</p>
<h4 id="索引的优点"><a href="#索引的优点" class="headerlink" title="索引的优点"></a>索引的优点</h4><blockquote>
<p>大大减轻了服务器需要扫描的数据量，从而提高了数据的检索速度</p>
<p>帮助服务器避免排序和临时表</p>
<p>可以将随机I/O变为顺序I/O</p>
</blockquote>
<h4 id="索引类型"><a href="#索引类型" class="headerlink" title="索引类型"></a>索引类型</h4>
    

        <a href="/2017/08/29/如何在MySQL中使用索引/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/MySQL/">MySQL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/数据库/">数据库</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/索引/">索引</a></li></ul>

    </div>
    
</article>

        </li>
    
    </ul>

    
<nav id="page-nav">
    <div class="inner">
    <a class="extend prev" rel="prev" href="/page/7/">上一页</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/6/">6</a><a class="page-number" href="/page/7/">7</a><span class="page-number current">8</span><a class="page-number" href="/page/9/">9</a><a class="page-number" href="/page/10/">10</a><a class="extend next" rel="next" href="/page/9/">下一页</a>
    </div>
</nav>


</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>我的技术小房间 &copy; 2015 - 2020</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://lvshen9.gitee.io/page/8/&title=Lvshen's Blog&pic=https://lvshen9.gitee.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://lvshen9.gitee.io/page/8/&title=Lvshen's Blog&source=学如逆水行舟，不进则退" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://lvshen9.gitee.io/page/8/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=Lvshen's Blog&url=https://lvshen9.gitee.io/page/8/&via=https://lvshen9.gitee.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://lvshen9.gitee.io/page/8/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="//api.qrserver.com/v1/create-qr-code/?data=https://lvshen9.gitee.io/page/8/" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '死鬼去哪里了！';
            clearTimeout(titleTime);
        } else {
            document.title = '(つェ⊂)咦!又好了!';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
